public class Tset {
    public static void main(String[] args) {
        MyArray<String> myArray1=new MyArray<>();
        myArray1.setArray(0,"hello");
        myArray1.setArray(1,"world");
        String str=myArray1.getVal(0);
        System.out.println(str);
    }
    public static void main2(String[] args) {
        Integer a=100;
        Integer b=100;
        System.out.println(a==b);//装箱，valueof方法
    }
    public static void main1(String[] args) {
        int i=10;
        Integer a=i;//自动的装箱
        Integer b=Integer.valueOf(19);//显示装箱

        int k=a;//自动拆箱
        int kk=a.intValue();
    }

}
class MyArray<T>{//编译时其实T就是Object
    public Object[] array=new Object[3];
    public void setArray(int pos,T val){
        array[pos]=val;
    }

    public T getVal(int pos){
        return (T)array[pos];
    }
}
